package com.tuyrt.`as`.proj.main.http.api

import com.tuyrt.`as`.proj.main.model.ArticleBean
import com.tuyrt.hi.library.restful.HiCall
import com.tuyrt.hi.library.restful.annotation.BaseUrl
import com.tuyrt.hi.library.restful.annotation.Field
import com.tuyrt.hi.library.restful.annotation.GET
import org.json.JSONObject

/**
 * author: Administrator on 2021/6/24.
 * desc:
 */
interface TestApi {

    @GET("cities")
    fun listCities(@Field("name") name: String): HiCall<JSONObject>

    // https://wanandroid.com/wxarticle/chapters/json
    @BaseUrl("https://wanandroid.com/")
    @GET("wxarticle/chapters/json")
    fun getArticle(): HiCall<List<ArticleBean>>

    /**
    ApiFactory.INSTANCE.create(TestApi.class).getArticle()
    .enqueue(new HiCallback<List<ArticleBean>>() {

    @Override
    public void onFailed(@NotNull Throwable throwable) {
    }

    @Override
    public void onSuccess(@NotNull HiResponse<List<ArticleBean>> response) {
    }
    });
     */
}